import type { Meta, StoryObj } from "@storybook/react";
import { fn } from "@storybook/test";
import { Icon } from "../Icon";

import { LfButton } from ".";
const meta = {
  title: "示例/按钮",
  component: LfButton,
  parameters: {
    layout: "centered",
  },
  argTypes: {
    backgroundColor: { control: "color" },
    color: { control: "color" },
  },
  args: { onClick: fn() },
} satisfies Meta<typeof LfButton>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Primary: Story = {
  name: "主要按钮",
  args: {
    type: "primary",
    iconPosition: "start",
    size: "default",
    danger: false,
    loading: false,
    icon: [<Icon name="r" slot="prefix" key={0} />],
    children: "按钮",
  },
};
